package com.time.workshop.ui.fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.time.workshop.BaseFragment;
import com.time.workshop.R;

public class ViewpagerFragment extends BaseFragment
{

	private int position;
	private ImageView img;

	public ViewpagerFragment getInstance(int position)
	{
		this.position = position;
		return new ViewpagerFragment();
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
	{
		return inflater.inflate(R.layout.fragment_viewpager, container, false);
	}

	@Override
	public void onViewCreated(View view, Bundle savedInstanceState)
	{
		super.onViewCreated(view, savedInstanceState);
		img = (ImageView) view.findViewById(R.id.imgs);
		if (position == 0)
		{
			img.setImageResource(R.drawable.start1);
		} else if (position == 1)
		{
			img.setImageResource(R.drawable.start2);
		} else if (position == 2)
		{
			img.setImageResource(R.drawable.start3);
		}
	}

}
